package biz;

import bean.EmpInfo;
import dao.EmpInfoDAO;

import java.util.List;

public class EmpBiz {
    private EmpInfoDAO eidao = new EmpInfoDAO();
    public List<EmpInfo> findAllEmp(){
        return eidao.findAllEmp();
    }
    public int findEmpAllPageNum(int size){
        int count = eidao.findEmpAllCount();
        int pageNum = (count%size==0)?(count/size):(count/size+1);
        return pageNum;
    }
    public List<EmpInfo> findEmpByPage(int page){
        int start = (page-1)*5;
        return eidao.findEmpByPage(start,5);
    }
    public void deleteEmp(int empNo){
        eidao.deleteEmp(empNo);
    }
}
